{% extends 'html模板/案件-base.html' %}
{% load staticfiles %}
{% block css %}
    <style>
        .table > tr > th, .table > tbody > tr > td {
            text-align: center;
        }
    </style>
{% endblock %}

{% block mianbaoxiedaohang %}
    案件统计报表
{% endblock %}

{% block main %}
    <div class="row-fluid">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title"><span class="icon"> <i class="icon-th"></i> </span>
                    <h5>按省辖市统计</h5>
                </div>
                <div class="widget-content nopadding">
                    <table class="table table-bordered table-striped">
                        <thead>
                        <tr>
                            {% for foo in obj1.columns %}
                                <th>{{ foo }}</th>
                            {% endfor %}
                        </tr>
                        </thead>
                        <tbody>
                        {% if request.user.level == '1' %}
                            {% for r in obj1.data %}
                                {% if not forloop.last %}
                                    <tr>
                                        {% for c in r %}
                                            {% if forloop.first %}
                                                <td><a href="?s={{ c }}">{{ c }}</a></td>
                                            {% else %}
                                                <td>{{ c }}</td>
                                            {% endif %}
                                        {% endfor %}
                                    </tr>
                                {% else %}
                                    <tr>
                                        {% for c in  r %}
                                            <td>{{ c }}</td>
                                        {% endfor %}
                                    </tr>
                                {% endif %}
                            {% endfor %}
                        {% else %}
                            {% for r in obj1.data %}
                                <tr>
                                    {% for c in r %}
                                        <td>{{ c }}</td>
                                    {% endfor %}
                                </tr>
                            {% endfor %}
                        {% endif %}
                        </tbody>
                        <tfoot>
                        </tfoot>
                    </table>
                </div>
            </div>
        </div>
    </div>

    <div class="row-fluid">
        <div class="span12">
            <div class="widget-box">
                <div class="widget-title"><span class="icon"> <i class="icon-th"></i> </span>
                    <h5>按案件类型统计</h5>
                </div>
                <div class="widget-content nopadding">
                    <table class="table table-bordered table-striped">
                        <thead>
                        <tr>
                            {% for foo in obj2.columns %}
                                <th>{{ foo }}</th>
                            {% endfor %}
                        </tr>
                        </thead>
                        <tbody>
                        {% for r in obj2.data %}
                            <tr>
                                {% for c in r %}
                                    <td>{{ c }}</td>
                                {% endfor %}
                            </tr>
                        {% endfor %}
                        </tbody>
                        <tfoot>
                        </tfoot>
                    </table>
                </div>
            </div>
        </div>
    </div>

{% endblock %}

{% block js %}
    <script>
        $('.ajtj').addClass('active')
    </script>
{% endblock %}